home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesC-D.lzh / ChampionshipGolf.lha / ChampionShipGolfHd / Install < prev    next >
Text File  |  2001-11-23  |  6KB  |  317 lines

  1. ;****************************
  2. (set #sub-dir "data")                   ;sub directory containing data files
  3. (set #readme-file "ReadMe")             ;name of the readme file
  4. (set #docs-file "Docs")             ;name of the readme file
  5. (set #cheat-file "cheat")             ;name of the readme file
  6. (set #highs-file "highs")               ;name of high scores file
  7.  
  8. (procedure P_MakeImages
  9.  
  10.   ;the following lines must be copied and adjusted for multiple disk images
  11.  
  12.   (set #CI_disknum 1)
  13.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  14.   (set #CI_disklen 901120)
  15.   (set #CI_skiptrk "2,3")
  16.   (P_CreateImage)
  17.  
  18.  
  19. )
  20.  
  21. ;****************************
  22. ;----------------------------
  23. ; checks if given program is installed, if not abort install
  24. ; #program - to check
  25.  
  26. (procedure P_ChkRun
  27.   (if
  28.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  29.     ("")
  30.     (abort 
  31.       (cat
  32.         "You must install \"" #program "\" first!\n"
  33.         "It must be accessible via the path.\n"
  34.         "You can find it in the WHDLoad package."
  35.       )
  36.     )
  37.   )
  38. )
  39.  
  40. ;----------------------------
  41. ; Create Image using DIC
  42. ; #dest        - path to save image in
  43. ; #CI_disknum  - number of the disk image to create
  44. ; #CI_diskname - label of the disk
  45. ; #CI_disklen  - length of disk image to create
  46. ; #CI_skiptrk  - track to skip, -1 means no skip
  47. ; #CI_drive    - drive to create image from
  48.  
  49. (procedure P_CreateImage
  50.   (message
  51.     (cat
  52.         "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  53.         "(make sure it's the right disk because it will not be checked)"
  54.     )
  55.   )
  56.   (if
  57.     (>= #CI_skiptrk 0)
  58.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  59.     (set #option "")
  60.   )
  61.   (if
  62.     (= 0
  63.       (run 
  64.         (cat
  65.           "cd \"" #dest "\"\n"
  66.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  67.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  68.         )
  69.       )
  70.     )
  71.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  72.     (abort "\"DIC\" has failed to create a diskimage")
  73.   )
  74. )
  75.  
  76. ;****************************
  77.  
  78. (if
  79.   (exists #readme-file)
  80.   (if
  81.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  82.     ("")
  83.     (run ("SYS:Utilities/More %s" #readme-file))
  84.   )
  85. )
  86.  
  87. (set #program "WHDLoad")
  88. (P_ChkRun)
  89.  
  90. (set #program "DIC")
  91. (P_ChkRun)
  92.  
  93. ; in expert mode ask for source drive
  94. (if
  95.   (= @user-level 2)
  96.   (
  97.     (set #CI_drive
  98.       (askchoice
  99.         (prompt "Select source drive for diskimages")
  100.         (default 0)
  101.         (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  102.         (help @askchoice-help)
  103.       )
  104.     )
  105.     (select #CI_drive
  106.       (set #CI_drive "DF0:")
  107.       (set #CI_drive "DF1:")
  108.       (set #CI_drive "RAD:")
  109.       (set #CI_drive
  110.         (askstring
  111.           (prompt "Select source drive for diskimages")
  112.           (default "DF0:")
  113.           (help @askstring-help)
  114.         )
  115.       )
  116.     )
  117.   )
  118.   (set #CI_drive "DF0:")
  119. )
  120.  
  121. (if
  122.   (getenv "WHDLInstPath")
  123.   (set @default-dest (getenv "WHDLInstPath"))
  124. )
  125. (set #dest
  126.   (askdir
  127.     (prompt 
  128.       (cat
  129.         "Where should \"" @app-name "\" be installed?\n"
  130.         "A drawer \"" @app-name "\" will be automatically created."
  131.       )
  132.     )
  133.     (help @askdir-help)
  134.     (default @default-dest)
  135.     (disk)
  136.   )
  137. )
  138. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" @default-dest))
  139. (set #dest (tackon #dest @app-name))
  140. (if
  141.   (exists #dest)
  142.   (
  143.     (set #choice
  144.       (askbool
  145.         (prompt
  146.           (cat
  147.             "\nDirectory \"" #dest "\" already exists.\n"
  148.             "Should it be deleted?"
  149.           )
  150.         )
  151.         (default 1)
  152.         (choices "Delete" "Skip")
  153.         (help @askbool-help)
  154.       )
  155.     )
  156.     (if
  157.       (= #choice 1)
  158.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  159.     )
  160.   )
  161. )
  162. (makedir #dest
  163.   (help @makedir-help)
  164.   (infos)
  165. )
  166.  
  167. ;----------------------------
  168.  
  169. (copyfiles
  170.   (help @copyfiles-help)
  171.   (source ("%s.Slave" @app-name))
  172.   (dest #dest)
  173. )
  174. (if
  175.   (exists ("%s.GlowIcon" @app-name))
  176.   (set #icon
  177.     (askchoice
  178.       (prompt "\nWhich icon would you like to install?\n")
  179.       (default 0)
  180.       (choices "Normal" "CFou's GlowIcon")
  181.       (help @askchoice-help)
  182.     )
  183.   )
  184.   (set #icon 0)
  185. )
  186. (select #icon
  187.   (set #icon ("%s.inf" @app-name))
  188.   (set #icon ("%s.GlowIcon" @app-name))
  189. )
  190. (copyfiles
  191.   (help @copyfiles-help)
  192.   (source #icon)
  193.   (newname ("%s.info" @app-name))
  194.   (dest #dest)
  195. )
  196. (tooltype
  197.   (dest (tackon #dest @app-name))
  198.   (settooltype "Slave")
  199.   (settooltype "PreLoad")
  200. )
  201. (tooltype
  202.   (dest (tackon #dest @app-name))
  203.   (settooltype "PreLoad" "")
  204.   (settooltype "Slave" ("%s.Slave" @app-name))
  205.   (setdefaulttool "WHDLoad")
  206.   (setstack 10240)
  207.   (noposition)
  208. )
  209. (if
  210.   (exists #readme-file)
  211.   (copyfiles
  212.     (help @copyfiles-help)
  213.     (source #readme-file)
  214.     (dest #dest)
  215.   )
  216. )
  217. (if
  218.   (exists ("%s.info" #readme-file))
  219.   (
  220.     (copyfiles
  221.       (help @copyfiles-help)
  222.       (source ("%s.info" #readme-file))
  223.       (dest #dest)
  224.     )
  225.     (tooltype
  226.       (dest (tackon #dest #readme-file))
  227.       (noposition)
  228.     )
  229.   )
  230. )
  231.  
  232. (if
  233.   (exists #docs-file)
  234.   (copyfiles
  235.     (help @copyfiles-help)
  236.     (source #docs-file)
  237.     (dest #dest)
  238.   )
  239. )
  240. (if
  241.   (exists ("%s.info" #docs-file))
  242.   (
  243.     (copyfiles
  244.       (help @copyfiles-help)
  245.       (source ("%s.info" #docs-file))
  246.       (dest #dest)
  247.     )
  248.     (tooltype
  249.       (dest (tackon #dest #docs-file))
  250.       (noposition)
  251.     )
  252.   )
  253. )
  254.  
  255.  
  256. (if
  257.   (exists #cheat-file)
  258.   (copyfiles
  259.     (help @copyfiles-help)
  260.     (source #cheat-file)
  261.     (dest #dest)
  262.   )
  263. )
  264. (if
  265.   (exists ("%s.info" #cheat-file))
  266.   (
  267.     (copyfiles
  268.       (help @copyfiles-help)
  269.       (source ("%s.info" #cheat-file))
  270.       (dest #dest)
  271.     )
  272.     (tooltype
  273.       (dest (tackon #dest #cheat-file))
  274.       (noposition)
  275.     )
  276.   )
  277. )
  278.  
  279.  
  280. (if
  281.   (= #sub-dir "")
  282.   ("")
  283.   (
  284.     (set #dest (tackon #dest #sub-dir))
  285.     (makedir #dest
  286.       (help @makedir-help)
  287.     )
  288.   )
  289. )
  290. (if
  291.   (exists #highs-file)
  292.   (copyfiles
  293.     (help @copyfiles-help)
  294.     (source #highs-file)
  295.     (dest #dest)
  296.   )
  297. )
  298.    
  299.  
  300.  
  301.  
  302. (if
  303.   (exists #highs-file)
  304.   (copyfiles
  305.     (help @copyfiles-help)
  306.     (source #highs-file)
  307.     (dest #dest)
  308.   )
  309. )
  310.  
  311. (P_MakeImages)
  312.  
  313. ;----------------------------
  314.  
  315. (exit)
  316.  
  317.